package com.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.ContestCreditsDao;
import com.entity.ContestCreditsEntity;
import com.entity.vo.ContestCreditsVo;
import com.service.ContestCreditsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author mgl
 * @version 1.0
 * @description 实现类
 * @date 2024/4/10 14:19
 */
@Service
public class ContestCreditsServiceImpl extends ServiceImpl<ContestCreditsDao, ContestCreditsEntity> implements ContestCreditsService {

    @Autowired
    private ContestCreditsDao contestCreditsDao;
    @Override
    public List<ContestCreditsVo> selectAll(Integer pageNo, Integer pageSize, String contestTypeName) {
        if (pageNo == null || pageSize == null) return contestCreditsDao.selectAll(null, null, contestTypeName);
        return contestCreditsDao.selectAll((pageNo - 1) * pageSize, pageSize, contestTypeName);
    }
}
